package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.view.View;
import androidx.lifecycle.OnLifecycleEvent;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.a;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import o.cgz;
import o.emp;
import o.CollectCheck;
import o.kp.e;
import o.kt;
import o.kv;

public class HorizontalVideoStreamCard extends NormalHorizonCard {
    public HorizontalVideoStreamCard(Context context) {
        super(context);
    }

    public void ˋ(a aVar, RecyclerView recyclerView) {
        aVar.ˋ(true);
        recyclerView.setItemAnimator(null);
    }

    public boolean ʽ() {
        return true;
    }

    public cgz ˏ(View view) {
        if (view.getContext() instanceof kv) {
            final kv kvVar = (kv) view.getContext();
            kvVar.ac_().ॱ(new kt(this) {
                final /* synthetic */ HorizontalVideoStreamCard ˎ;

                @OnLifecycleEvent(e.ON_RESUME)
                public void onResume() {
                    if (this.ˎ.ॱ != null && !CollectCheck.isEmpty((List) emp.ˎ().ˊ.get(Long.valueOf(this.ˎ.ॱ.ˎ())))) {
                        int intValue;
                        Collection arrayList = new ArrayList((Collection) emp.ˎ().ˊ.get(Long.valueOf(this.ˎ.ॱ.ˎ())));
                        Integer num = (Integer) emp.ˎ().ˋ.get(Long.valueOf(this.ˎ.ॱ.ˎ()));
                        if (num != null) {
                            intValue = num.intValue();
                        } else {
                            intValue = 0;
                        }
                        emp.ˎ().ˊ.remove(Long.valueOf(this.ˎ.ॱ.ˎ()));
                        emp.ˎ().ˋ.remove(Long.valueOf(this.ˎ.ॱ.ˎ()));
                        this.ˎ.ᐝॱ().ᐝ(intValue);
                        if (this.ˎ.ᐝॱ().ʻˋ().size() < this.ˎ.ᐝॱ().ʼˊ()) {
                            this.ˎ.ॱ.ॱ(false);
                        } else {
                            this.ˎ.ॱ.ॱ(true);
                        }
                        this.ˎ.ॱ.ॱ().clear();
                        this.ˎ.ॱ.ॱ().addAll(arrayList);
                        this.ˎ.ॱ.ॱ(2);
                        this.ˎ.ᐝॱ().ʻˋ().clear();
                        this.ˎ.ᐝॱ().ʻˋ().addAll(this.ˎ.ॱ.ॱ());
                        this.ˎ.ॱॱ().ˊ();
                        this.ˎ.ˊ.ॱ(intValue, 0);
                    }
                }

                @OnLifecycleEvent(e.ON_DESTROY)
                public void onDestroy() {
                    kvVar.ac_().ˋ(this);
                }
            });
        }
        return super.ˏ(view);
    }
}
